Usuń artefakt strategii.
DELETE https://management.azure.com/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/artifacts/{artifactName}?api-version=2018-11-01-preview
Parametry identyfikatora URI
Nazwa |
W |
Wymagane |
Typ |
Opis |
artifactName
|
path |
True
|
string
|
Nazwa artefaktu strategii.
|
blueprintName
|
path |
True
|
string
|
Nazwa definicji strategii.
|
resourceScope
|
path |
True
|
string
|
Zakres zasobu. Prawidłowe zakresy to: grupa zarządzania (format: "/providers/Microsoft.Management/managementGroups/{managementGroup}"), subskrypcja (format: "/subscriptions/{subscriptionId}").
|
api-version
|
query |
True
|
string
|
Wersja interfejsu API klienta.
|
Odpowiedzi
Nazwa |
Typ |
Opis |
200 OK
|
Artifact:
|
OK — artefakt strategii został usunięty.
|
204 No Content
|
|
Brak zawartości
|
Other Status Codes
|
CloudError
|
Odpowiedź na błąd strategii.
|
Zabezpieczenia
azure_auth
Przepływ OAuth2 usługi Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nazwa |
Opis |
user_impersonation
|
personifikacja konta użytkownika
|
Przykłady
MG-ARMTemplateArtifact
Sample Request
DELETE https://management.azure.com/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate?api-version=2018-11-01-preview
package armblueprint_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/blueprint/armblueprint"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/managementGroupBPDef/ARMTemplateArtifact_Delete.json
func ExampleArtifactsClient_Delete_mgArmTemplateArtifact() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armblueprint.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewArtifactsClient().Delete(ctx, "providers/Microsoft.Management/managementGroups/ContosoOnlineGroup", "simpleBlueprint", "storageTemplate", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armblueprint.ArtifactsClientDeleteResponse{
// ArtifactClassification: &armblueprint.TemplateArtifact{
// Name: to.Ptr("storageTemplate"),
// Type: to.Ptr("Microsoft.Blueprint/blueprints/artifacts"),
// ID: to.Ptr("/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate"),
// Kind: to.Ptr(armblueprint.ArtifactKindTemplate),
// Properties: &armblueprint.TemplateArtifactProperties{
// Parameters: map[string]*armblueprint.ParameterValue{
// "storageAccountType": &armblueprint.ParameterValue{
// Value: "[parameters('storageAccountType')]",
// },
// },
// ResourceGroup: to.Ptr("storageRG"),
// Template: map[string]any{
// "contentVersion": "1.0.0.0",
// "outputs":map[string]any{
// "storageAccountName":map[string]any{
// "type": "string",
// "value": "[variables('storageAccountName')]",
// },
// },
// "parameters":map[string]any{
// "storageAccountType":map[string]any{
// "type": "string",
// "allowedValues":[]any{
// "Standard_LRS",
// "Standard_GRS",
// "Standard_ZRS",
// "Premium_LRS",
// },
// "defaultValue": "Standard_LRS",
// "metadata":map[string]any{
// "description": "Storage Account type",
// },
// },
// },
// "resources":[]any{
// map[string]any{
// "name": "[variables('storageAccountName')]",
// "type": "Microsoft.Storage/storageAccounts",
// "apiVersion": "2016-01-01",
// "kind": "Storage",
// "location": "[resourceGroup().location]",
// "properties":map[string]any{
// },
// "sku":map[string]any{
// "name": "[parameters('storageAccountType')]",
// },
// },
// },
// "variables":map[string]any{
// "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'standardsa')]",
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
using Azure.ResourceManager.Blueprint.Models;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/managementGroupBPDef/ARMTemplateArtifact_Delete.json
// this example is just showing the usage of "Artifacts_Delete" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BlueprintArtifactResource created on azure
// for more information of creating BlueprintArtifactResource, please refer to the document of BlueprintArtifactResource
string resourceScope = "providers/Microsoft.Management/managementGroups/ContosoOnlineGroup";
string blueprintName = "simpleBlueprint";
string artifactName = "storageTemplate";
ResourceIdentifier blueprintArtifactResourceId = BlueprintArtifactResource.CreateResourceIdentifier(resourceScope, blueprintName, artifactName);
BlueprintArtifactResource blueprintArtifact = client.GetBlueprintArtifactResource(blueprintArtifactResourceId);
// invoke the operation
ArmOperation<BlueprintArtifactResource> lro = await blueprintArtifact.DeleteAsync(WaitUntil.Completed);
BlueprintArtifactResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ArtifactData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"properties": {
"template": {
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountType": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_GRS",
"Standard_ZRS",
"Premium_LRS"
],
"metadata": {
"description": "Storage Account type"
}
}
},
"variables": {
"storageAccountName": "[concat(uniquestring(resourceGroup().id), 'standardsa')]"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"apiVersion": "2016-01-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "[parameters('storageAccountType')]"
},
"kind": "Storage",
"properties": {}
}
],
"outputs": {
"storageAccountName": {
"type": "string",
"value": "[variables('storageAccountName')]"
}
}
},
"resourceGroup": "storageRG",
"parameters": {
"storageAccountType": {
"value": "[parameters('storageAccountType')]"
}
}
},
"kind": "template",
"id": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "storageTemplate"
}
MG-PolicyAssignmentArtifact
Sample Request
DELETE https://management.azure.com/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/costCenterPolicy?api-version=2018-11-01-preview
package armblueprint_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/blueprint/armblueprint"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/managementGroupBPDef/PolicyAssignmentArtifact_Delete.json
func ExampleArtifactsClient_Delete_mgPolicyAssignmentArtifact() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armblueprint.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewArtifactsClient().Delete(ctx, "providers/Microsoft.Management/managementGroups/ContosoOnlineGroup", "simpleBlueprint", "costCenterPolicy", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armblueprint.ArtifactsClientDeleteResponse{
// ArtifactClassification: &armblueprint.PolicyAssignmentArtifact{
// Name: to.Ptr("costCenterPolicy"),
// Type: to.Ptr("Microsoft.Blueprint/blueprints/artifacts"),
// ID: to.Ptr("/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/costCenterPolicy"),
// Kind: to.Ptr(armblueprint.ArtifactKindPolicyAssignment),
// Properties: &armblueprint.PolicyAssignmentArtifactProperties{
// DisplayName: to.Ptr("force costCenter tag on all resources"),
// Parameters: map[string]*armblueprint.ParameterValue{
// "tagName": &armblueprint.ParameterValue{
// Value: "costCenter",
// },
// "tagValue": &armblueprint.ParameterValue{
// Value: "[parameter('costCenter')]",
// },
// },
// PolicyDefinitionID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
using Azure.ResourceManager.Blueprint.Models;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/managementGroupBPDef/PolicyAssignmentArtifact_Delete.json
// this example is just showing the usage of "Artifacts_Delete" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BlueprintArtifactResource created on azure
// for more information of creating BlueprintArtifactResource, please refer to the document of BlueprintArtifactResource
string resourceScope = "providers/Microsoft.Management/managementGroups/ContosoOnlineGroup";
string blueprintName = "simpleBlueprint";
string artifactName = "costCenterPolicy";
ResourceIdentifier blueprintArtifactResourceId = BlueprintArtifactResource.CreateResourceIdentifier(resourceScope, blueprintName, artifactName);
BlueprintArtifactResource blueprintArtifact = client.GetBlueprintArtifactResource(blueprintArtifactResourceId);
// invoke the operation
ArmOperation<BlueprintArtifactResource> lro = await blueprintArtifact.DeleteAsync(WaitUntil.Completed);
BlueprintArtifactResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ArtifactData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"properties": {
"displayName": "force costCenter tag on all resources",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62",
"parameters": {
"tagName": {
"value": "costCenter"
},
"tagValue": {
"value": "[parameter('costCenter')]"
}
}
},
"kind": "policyAssignment",
"id": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/costCenterPolicy",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "costCenterPolicy"
}
MG-RoleAssignmentArtifact
Sample Request
DELETE https://management.azure.com/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/ownerAssignment?api-version=2018-11-01-preview
package armblueprint_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/blueprint/armblueprint"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/managementGroupBPDef/RoleAssignmentArtifact_Delete.json
func ExampleArtifactsClient_Delete_mgRoleAssignmentArtifact() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armblueprint.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewArtifactsClient().Delete(ctx, "providers/Microsoft.Management/managementGroups/ContosoOnlineGroup", "simpleBlueprint", "ownerAssignment", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armblueprint.ArtifactsClientDeleteResponse{
// ArtifactClassification: &armblueprint.RoleAssignmentArtifact{
// Name: to.Ptr("ownerAssignment"),
// Type: to.Ptr("Microsoft.Blueprint/blueprints/artifacts"),
// ID: to.Ptr("/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/ownerAssignment"),
// Kind: to.Ptr(armblueprint.ArtifactKindRoleAssignment),
// Properties: &armblueprint.RoleAssignmentArtifactProperties{
// DisplayName: to.Ptr("enforce owners of given subscription"),
// PrincipalIDs: "[parameters('owners')]",
// RoleDefinitionID: to.Ptr("/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
using Azure.ResourceManager.Blueprint.Models;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/managementGroupBPDef/RoleAssignmentArtifact_Delete.json
// this example is just showing the usage of "Artifacts_Delete" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BlueprintArtifactResource created on azure
// for more information of creating BlueprintArtifactResource, please refer to the document of BlueprintArtifactResource
string resourceScope = "providers/Microsoft.Management/managementGroups/ContosoOnlineGroup";
string blueprintName = "simpleBlueprint";
string artifactName = "ownerAssignment";
ResourceIdentifier blueprintArtifactResourceId = BlueprintArtifactResource.CreateResourceIdentifier(resourceScope, blueprintName, artifactName);
BlueprintArtifactResource blueprintArtifact = client.GetBlueprintArtifactResource(blueprintArtifactResourceId);
// invoke the operation
ArmOperation<BlueprintArtifactResource> lro = await blueprintArtifact.DeleteAsync(WaitUntil.Completed);
BlueprintArtifactResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ArtifactData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"properties": {
"displayName": "enforce owners of given subscription",
"roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7",
"principalIds": "[parameters('owners')]"
},
"kind": "roleAssignment",
"id": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/ownerAssignment",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "ownerAssignment"
}
Sub-ARMTemplateArtifact
Sample Request
DELETE https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate?api-version=2018-11-01-preview
package armblueprint_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/blueprint/armblueprint"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/subscriptionBPDef/ARMTemplateArtifact_Delete.json
func ExampleArtifactsClient_Delete_subArmTemplateArtifact() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armblueprint.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewArtifactsClient().Delete(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "simpleBlueprint", "storageTemplate", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armblueprint.ArtifactsClientDeleteResponse{
// ArtifactClassification: &armblueprint.TemplateArtifact{
// Name: to.Ptr("storageTemplate"),
// Type: to.Ptr("Microsoft.Blueprint/blueprints/artifacts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate"),
// Kind: to.Ptr(armblueprint.ArtifactKindTemplate),
// Properties: &armblueprint.TemplateArtifactProperties{
// Parameters: map[string]*armblueprint.ParameterValue{
// "storageAccountType": &armblueprint.ParameterValue{
// Value: "[parameters('storageAccountType')]",
// },
// },
// ResourceGroup: to.Ptr("storageRG"),
// Template: map[string]any{
// "contentVersion": "1.0.0.0",
// "outputs":map[string]any{
// "storageAccountName":map[string]any{
// "type": "string",
// "value": "[variables('storageAccountName')]",
// },
// },
// "parameters":map[string]any{
// "storageAccountType":map[string]any{
// "type": "string",
// "allowedValues":[]any{
// "Standard_LRS",
// "Standard_GRS",
// "Standard_ZRS",
// "Premium_LRS",
// },
// "defaultValue": "Standard_LRS",
// "metadata":map[string]any{
// "description": "Storage Account type",
// },
// },
// },
// "resources":[]any{
// map[string]any{
// "name": "[variables('storageAccountName')]",
// "type": "Microsoft.Storage/storageAccounts",
// "apiVersion": "2016-01-01",
// "kind": "Storage",
// "location": "[resourceGroup().location]",
// "properties":map[string]any{
// },
// "sku":map[string]any{
// "name": "[parameters('storageAccountType')]",
// },
// },
// },
// "variables":map[string]any{
// "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'standardsa')]",
// },
// },
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
using Azure.ResourceManager.Blueprint.Models;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/subscriptionBPDef/ARMTemplateArtifact_Delete.json
// this example is just showing the usage of "Artifacts_Delete" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BlueprintArtifactResource created on azure
// for more information of creating BlueprintArtifactResource, please refer to the document of BlueprintArtifactResource
string resourceScope = "subscriptions/00000000-0000-0000-0000-000000000000";
string blueprintName = "simpleBlueprint";
string artifactName = "storageTemplate";
ResourceIdentifier blueprintArtifactResourceId = BlueprintArtifactResource.CreateResourceIdentifier(resourceScope, blueprintName, artifactName);
BlueprintArtifactResource blueprintArtifact = client.GetBlueprintArtifactResource(blueprintArtifactResourceId);
// invoke the operation
ArmOperation<BlueprintArtifactResource> lro = await blueprintArtifact.DeleteAsync(WaitUntil.Completed);
BlueprintArtifactResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ArtifactData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"properties": {
"template": {
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountType": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_GRS",
"Standard_ZRS",
"Premium_LRS"
],
"metadata": {
"description": "Storage Account type"
}
}
},
"variables": {
"storageAccountName": "[concat(uniquestring(resourceGroup().id), 'standardsa')]"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"apiVersion": "2016-01-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "[parameters('storageAccountType')]"
},
"kind": "Storage",
"properties": {}
}
],
"outputs": {
"storageAccountName": {
"type": "string",
"value": "[variables('storageAccountName')]"
}
}
},
"resourceGroup": "storageRG",
"parameters": {
"storageAccountType": {
"value": "[parameters('storageAccountType')]"
}
}
},
"kind": "template",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "storageTemplate"
}
Sub-PolicyAssignmentArtifact
Sample Request
DELETE https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/costCenterPolicy?api-version=2018-11-01-preview
package armblueprint_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/blueprint/armblueprint"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/subscriptionBPDef/PolicyAssignmentArtifact_Delete.json
func ExampleArtifactsClient_Delete_subPolicyAssignmentArtifact() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armblueprint.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewArtifactsClient().Delete(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "simpleBlueprint", "costCenterPolicy", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armblueprint.ArtifactsClientDeleteResponse{
// ArtifactClassification: &armblueprint.PolicyAssignmentArtifact{
// Name: to.Ptr("costCenterPolicy"),
// Type: to.Ptr("Microsoft.Blueprint/blueprints/artifacts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/costCenterPolicy"),
// Kind: to.Ptr(armblueprint.ArtifactKindPolicyAssignment),
// Properties: &armblueprint.PolicyAssignmentArtifactProperties{
// DisplayName: to.Ptr("force costCenter tag on all resources"),
// Parameters: map[string]*armblueprint.ParameterValue{
// "tagName": &armblueprint.ParameterValue{
// Value: "costCenter",
// },
// "tagValue": &armblueprint.ParameterValue{
// Value: "[parameter('costCenter')]",
// },
// },
// PolicyDefinitionID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
using Azure.ResourceManager.Blueprint.Models;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/subscriptionBPDef/PolicyAssignmentArtifact_Delete.json
// this example is just showing the usage of "Artifacts_Delete" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BlueprintArtifactResource created on azure
// for more information of creating BlueprintArtifactResource, please refer to the document of BlueprintArtifactResource
string resourceScope = "subscriptions/00000000-0000-0000-0000-000000000000";
string blueprintName = "simpleBlueprint";
string artifactName = "costCenterPolicy";
ResourceIdentifier blueprintArtifactResourceId = BlueprintArtifactResource.CreateResourceIdentifier(resourceScope, blueprintName, artifactName);
BlueprintArtifactResource blueprintArtifact = client.GetBlueprintArtifactResource(blueprintArtifactResourceId);
// invoke the operation
ArmOperation<BlueprintArtifactResource> lro = await blueprintArtifact.DeleteAsync(WaitUntil.Completed);
BlueprintArtifactResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ArtifactData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"properties": {
"displayName": "force costCenter tag on all resources",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62",
"parameters": {
"tagName": {
"value": "costCenter"
},
"tagValue": {
"value": "[parameter('costCenter')]"
}
}
},
"kind": "policyAssignment",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/costCenterPolicy",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "costCenterPolicy"
}
Sub-RoleAssignmentArtifact
Sample Request
DELETE https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/ownerAssignment?api-version=2018-11-01-preview
package armblueprint_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/blueprint/armblueprint"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/subscriptionBPDef/RoleAssignmentArtifact_Delete.json
func ExampleArtifactsClient_Delete_subRoleAssignmentArtifact() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armblueprint.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewArtifactsClient().Delete(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "simpleBlueprint", "ownerAssignment", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armblueprint.ArtifactsClientDeleteResponse{
// ArtifactClassification: &armblueprint.RoleAssignmentArtifact{
// Name: to.Ptr("ownerAssignment"),
// Type: to.Ptr("Microsoft.Blueprint/blueprints/artifacts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/ownerAssignment"),
// Kind: to.Ptr(armblueprint.ArtifactKindRoleAssignment),
// Properties: &armblueprint.RoleAssignmentArtifactProperties{
// DisplayName: to.Ptr("enforce owners of given subscription"),
// PrincipalIDs: "[parameters('owners')]",
// RoleDefinitionID: to.Ptr("/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
using Azure.ResourceManager.Blueprint.Models;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/subscriptionBPDef/RoleAssignmentArtifact_Delete.json
// this example is just showing the usage of "Artifacts_Delete" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BlueprintArtifactResource created on azure
// for more information of creating BlueprintArtifactResource, please refer to the document of BlueprintArtifactResource
string resourceScope = "subscriptions/00000000-0000-0000-0000-000000000000";
string blueprintName = "simpleBlueprint";
string artifactName = "ownerAssignment";
ResourceIdentifier blueprintArtifactResourceId = BlueprintArtifactResource.CreateResourceIdentifier(resourceScope, blueprintName, artifactName);
BlueprintArtifactResource blueprintArtifact = client.GetBlueprintArtifactResource(blueprintArtifactResourceId);
// invoke the operation
ArmOperation<BlueprintArtifactResource> lro = await blueprintArtifact.DeleteAsync(WaitUntil.Completed);
BlueprintArtifactResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ArtifactData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"properties": {
"displayName": "enforce owners of given subscription",
"roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7",
"principalIds": "[parameters('owners')]"
},
"kind": "roleAssignment",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/ownerAssignment",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "ownerAssignment"
}
Definicje
CloudError
Nazwa |
Typ |
Opis |
error
|
ErrorResponse
|
Odpowiedź na błąd
Typowa odpowiedź na błędy dla wszystkich interfejsów API usługi Azure Resource Manager zwraca szczegóły błędu dla operacji, które zakończyły się niepowodzeniem. (Jest to również zgodne z formatem odpowiedzi na błąd OData).
|
ErrorAdditionalInfo
Dodatkowe informacje o błędzie zarządzania zasobami.
Nazwa |
Typ |
Opis |
info
|
object
|
Dodatkowe informacje.
|
type
|
string
|
Dodatkowy typ informacji.
|
ErrorResponse
Odpowiedź na błąd
Nazwa |
Typ |
Opis |
additionalInfo
|
ErrorAdditionalInfo[]
|
Dodatkowe informacje o błędzie.
|
code
|
string
|
Kod błędu.
|
details
|
ErrorResponse[]
|
Szczegóły błędu.
|
message
|
string
|
Komunikat o błędzie.
|
target
|
string
|
Element docelowy błędu.
|
keyVaultReference
Określa link do Key Vault.
Nazwa |
Typ |
Opis |
id
|
string
|
Identyfikator zasobu platformy Azure Key Vault.
|
ParameterValue
Wartość określonego parametru. Może to być wartość lub odwołanie, ale nie oba.
Nazwa |
Typ |
Opis |
reference
|
SecretValueReference
|
Wartość parametru jako typ odwołania.
|
value
|
object
|
Wartość parametru. Dozwolona jest dowolna prawidłowa wartość JSON, w tym obiekty, tablice, ciągi, liczby i wartości logiczne.
|
PolicyAssignmentArtifact
Artefakt strategii, który stosuje przypisanie zasad.
Nazwa |
Typ |
Opis |
id
|
string
|
Identyfikator ciągu używany do lokalizowania dowolnego zasobu na platformie Azure.
|
kind
|
string:
policyAssignment
|
Określa rodzaj artefaktu strategii.
|
name
|
string
|
Nazwa tego zasobu.
|
properties.dependsOn
|
string[]
|
Artefakty, które należy wdrożyć przed określonym artefaktem.
|
properties.description
|
string
|
Wiele wierszy wyjaśnia ten zasób.
|
properties.displayName
|
string
|
Jeden ciąg liniowy wyjaśnia ten zasób.
|
properties.parameters
|
<string,
ParameterValue>
|
Wartości parametrów definicji zasad.
|
properties.policyDefinitionId
|
string
|
Identyfikator zasobu platformy Azure definicji zasad.
|
properties.resourceGroup
|
string
|
Nazwa symbolu zastępczego grupy zasobów, do którego zostaną przypisane zasady.
|
type
|
string
|
Typ tego zasobu.
|
RoleAssignmentArtifact
Artefakt strategii, który stosuje przypisanie roli.
Nazwa |
Typ |
Opis |
id
|
string
|
Identyfikator ciągu używany do lokalizowania dowolnego zasobu na platformie Azure.
|
kind
|
string:
roleAssignment
|
Określa rodzaj artefaktu strategii.
|
name
|
string
|
Nazwa tego zasobu.
|
properties.dependsOn
|
string[]
|
Artefakty, które należy wdrożyć przed określonym artefaktem.
|
properties.description
|
string
|
Wiele wierszy wyjaśnia ten zasób.
|
properties.displayName
|
string
|
Jeden ciąg liniowy wyjaśnia ten zasób.
|
properties.principalIds
|
|
Tablica tożsamości użytkowników lub grup w usłudze Azure Active Directory. Definicja roli będzie stosowana do każdej tożsamości.
|
properties.resourceGroup
|
string
|
RoleAssignment będzie zakresem dla tej grupy zasobów. Jeśli jest ona pusta, zakresy są ograniczone do subskrypcji.
|
properties.roleDefinitionId
|
string
|
Identyfikator zasobu platformy Azure elementu RoleDefinition.
|
type
|
string
|
Typ tego zasobu.
|
SecretValueReference
Odwołanie do wpisu tajnego Key Vault.
Nazwa |
Typ |
Opis |
keyVault
|
keyVaultReference
|
Określa odwołanie do danej usługi Azure Key Vault.
|
secretName
|
string
|
Nazwa wpisu tajnego.
|
secretVersion
|
string
|
Wersja wpisu tajnego do użycia. Jeśli pole pozostanie puste, zostanie użyta najnowsza wersja wpisu tajnego.
|
TemplateArtifact
Artefakt strategii, który wdraża szablon Resource Manager.
Nazwa |
Typ |
Opis |
id
|
string
|
Identyfikator ciągu używany do lokalizowania dowolnego zasobu na platformie Azure.
|
kind
|
string:
template
|
Określa rodzaj artefaktu strategii.
|
name
|
string
|
Nazwa tego zasobu.
|
properties.dependsOn
|
string[]
|
Artefakty, które należy wdrożyć przed określonym artefaktem.
|
properties.description
|
string
|
Wiele wierszy wyjaśnia ten zasób.
|
properties.displayName
|
string
|
Jeden ciąg liniowy wyjaśnia ten zasób.
|
properties.parameters
|
<string,
ParameterValue>
|
Resource Manager wartości parametrów artefaktu strategii szablonu.
|
properties.resourceGroup
|
string
|
Jeśli ma to zastosowanie, symbol zastępczy grupy zasobów, do którego zostanie wdrożony artefakt strategii szablonu Resource Manager.
|
properties.template
|
object
|
Treść artefaktu strategii szablonu Resource Manager.
|
type
|
string
|
Typ tego zasobu.
|