package
0.20240715.1103416
Repository: https://github.com/hashicorp/go-azure-sdk.git
Documentation: pkg.go.dev

# README

github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-12-01/appserviceenvironments Documentation

The appserviceenvironments SDK allows for interaction with the Azure Resource Manager Service web (API Version 2023-12-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-12-01/appserviceenvironments"

Client Initialization

client := appserviceenvironments.NewAppServiceEnvironmentsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: AppServiceEnvironmentsClient.ApproveOrRejectPrivateEndpointConnection

ctx := context.TODO()
id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue", "privateEndpointConnectionValue")

payload := appserviceenvironments.RemotePrivateEndpointConnectionARMResource{
	// ...
}


if err := client.ApproveOrRejectPrivateEndpointConnectionThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: AppServiceEnvironmentsClient.ChangeVnet

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

payload := appserviceenvironments.VirtualNetworkProfile{
	// ...
}


// alternatively `client.ChangeVnet(ctx, id, payload)` can be used to do batched pagination
items, err := client.ChangeVnetComplete(ctx, id, payload)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.CreateOrUpdate

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

payload := appserviceenvironments.AppServiceEnvironmentResource{
	// ...
}


if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: AppServiceEnvironmentsClient.CreateOrUpdateMultiRolePool

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

payload := appserviceenvironments.WorkerPoolResource{
	// ...
}


if err := client.CreateOrUpdateMultiRolePoolThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: AppServiceEnvironmentsClient.CreateOrUpdateWorkerPool

ctx := context.TODO()
id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue", "workerPoolValue")

payload := appserviceenvironments.WorkerPoolResource{
	// ...
}


if err := client.CreateOrUpdateWorkerPoolThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: AppServiceEnvironmentsClient.Delete

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

if err := client.DeleteThenPoll(ctx, id, appserviceenvironments.DefaultDeleteOperationOptions()); err != nil {
	// handle the error
}

Example Usage: AppServiceEnvironmentsClient.DeleteAseCustomDnsSuffixConfiguration

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

read, err := client.DeleteAseCustomDnsSuffixConfiguration(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.DeletePrivateEndpointConnection

ctx := context.TODO()
id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue", "privateEndpointConnectionValue")

if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: AppServiceEnvironmentsClient.Get

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.GetAseCustomDnsSuffixConfiguration

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

read, err := client.GetAseCustomDnsSuffixConfiguration(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.GetAseV3NetworkingConfiguration

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

read, err := client.GetAseV3NetworkingConfiguration(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.GetDiagnosticsItem

ctx := context.TODO()
id := appserviceenvironments.NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue", "diagnosticValue")

read, err := client.GetDiagnosticsItem(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.GetInboundNetworkDependenciesEndpoints

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

// alternatively `client.GetInboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination
items, err := client.GetInboundNetworkDependenciesEndpointsComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.GetMultiRolePool

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

read, err := client.GetMultiRolePool(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.GetOutboundNetworkDependenciesEndpoints

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

// alternatively `client.GetOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination
items, err := client.GetOutboundNetworkDependenciesEndpointsComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.GetPrivateEndpointConnection

ctx := context.TODO()
id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue", "privateEndpointConnectionValue")

read, err := client.GetPrivateEndpointConnection(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.GetPrivateEndpointConnectionList

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

// alternatively `client.GetPrivateEndpointConnectionList(ctx, id)` can be used to do batched pagination
items, err := client.GetPrivateEndpointConnectionListComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.GetPrivateLinkResources

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

read, err := client.GetPrivateLinkResources(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.GetVipInfo

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

read, err := client.GetVipInfo(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.GetWorkerPool

ctx := context.TODO()
id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue", "workerPoolValue")

read, err := client.GetWorkerPool(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.List

ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

// alternatively `client.List(ctx, id)` can be used to do batched pagination
items, err := client.ListComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListAppServicePlans

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

// alternatively `client.ListAppServicePlans(ctx, id)` can be used to do batched pagination
items, err := client.ListAppServicePlansComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListByResourceGroup

ctx := context.TODO()
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")

// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination
items, err := client.ListByResourceGroupComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListCapacities

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

// alternatively `client.ListCapacities(ctx, id)` can be used to do batched pagination
items, err := client.ListCapacitiesComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListDiagnostics

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

read, err := client.ListDiagnostics(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.ListMultiRoleMetricDefinitions

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

// alternatively `client.ListMultiRoleMetricDefinitions(ctx, id)` can be used to do batched pagination
items, err := client.ListMultiRoleMetricDefinitionsComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListMultiRolePoolInstanceMetricDefinitions

ctx := context.TODO()
id := appserviceenvironments.NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue", "instanceValue")

// alternatively `client.ListMultiRolePoolInstanceMetricDefinitions(ctx, id)` can be used to do batched pagination
items, err := client.ListMultiRolePoolInstanceMetricDefinitionsComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListMultiRolePoolSkus

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

// alternatively `client.ListMultiRolePoolSkus(ctx, id)` can be used to do batched pagination
items, err := client.ListMultiRolePoolSkusComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListMultiRolePools

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

// alternatively `client.ListMultiRolePools(ctx, id)` can be used to do batched pagination
items, err := client.ListMultiRolePoolsComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListMultiRoleUsages

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

// alternatively `client.ListMultiRoleUsages(ctx, id)` can be used to do batched pagination
items, err := client.ListMultiRoleUsagesComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListOperations

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

read, err := client.ListOperations(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.ListUsages

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

// alternatively `client.ListUsages(ctx, id, appserviceenvironments.DefaultListUsagesOperationOptions())` can be used to do batched pagination
items, err := client.ListUsagesComplete(ctx, id, appserviceenvironments.DefaultListUsagesOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListWebApps

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

// alternatively `client.ListWebApps(ctx, id, appserviceenvironments.DefaultListWebAppsOperationOptions())` can be used to do batched pagination
items, err := client.ListWebAppsComplete(ctx, id, appserviceenvironments.DefaultListWebAppsOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListWebWorkerMetricDefinitions

ctx := context.TODO()
id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue", "workerPoolValue")

// alternatively `client.ListWebWorkerMetricDefinitions(ctx, id)` can be used to do batched pagination
items, err := client.ListWebWorkerMetricDefinitionsComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListWebWorkerUsages

ctx := context.TODO()
id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue", "workerPoolValue")

// alternatively `client.ListWebWorkerUsages(ctx, id)` can be used to do batched pagination
items, err := client.ListWebWorkerUsagesComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListWorkerPoolInstanceMetricDefinitions

ctx := context.TODO()
id := appserviceenvironments.NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue", "workerPoolValue", "instanceValue")

// alternatively `client.ListWorkerPoolInstanceMetricDefinitions(ctx, id)` can be used to do batched pagination
items, err := client.ListWorkerPoolInstanceMetricDefinitionsComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListWorkerPoolSkus

ctx := context.TODO()
id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue", "workerPoolValue")

// alternatively `client.ListWorkerPoolSkus(ctx, id)` can be used to do batched pagination
items, err := client.ListWorkerPoolSkusComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.ListWorkerPools

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

// alternatively `client.ListWorkerPools(ctx, id)` can be used to do batched pagination
items, err := client.ListWorkerPoolsComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.Reboot

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

read, err := client.Reboot(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.Resume

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

// alternatively `client.Resume(ctx, id)` can be used to do batched pagination
items, err := client.ResumeComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.Suspend

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

// alternatively `client.Suspend(ctx, id)` can be used to do batched pagination
items, err := client.SuspendComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServiceEnvironmentsClient.TestUpgradeAvailableNotification

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

read, err := client.TestUpgradeAvailableNotification(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.Update

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

payload := appserviceenvironments.AppServiceEnvironmentPatchResource{
	// ...
}


read, err := client.Update(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.UpdateAseCustomDnsSuffixConfiguration

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

payload := appserviceenvironments.CustomDnsSuffixConfiguration{
	// ...
}


read, err := client.UpdateAseCustomDnsSuffixConfiguration(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.UpdateAseNetworkingConfiguration

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

payload := appserviceenvironments.AseV3NetworkingConfiguration{
	// ...
}


read, err := client.UpdateAseNetworkingConfiguration(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.UpdateMultiRolePool

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

payload := appserviceenvironments.WorkerPoolResource{
	// ...
}


read, err := client.UpdateMultiRolePool(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.UpdateWorkerPool

ctx := context.TODO()
id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue", "workerPoolValue")

payload := appserviceenvironments.WorkerPoolResource{
	// ...
}


read, err := client.UpdateWorkerPool(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServiceEnvironmentsClient.Upgrade

ctx := context.TODO()
id := commonids.NewAppServiceEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentValue")

if err := client.UpgradeThenPoll(ctx, id); err != nil {
	// handle the error
}