Obtenga un artefacto para una definición de plano técnico publicada.
GET https://management.azure.com/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}/artifacts/{artifactName}?api-version=2018-11-01-preview
Parámetros de identificador URI
Nombre |
En |
Requerido |
Tipo |
Description |
artifactName
|
path |
True
|
string
|
Nombre del artefacto del plano técnico.
|
blueprintName
|
path |
True
|
string
|
Nombre de la definición del plano técnico.
|
resourceScope
|
path |
True
|
string
|
Ámbito del recurso. Los ámbitos válidos son: grupo de administración (formato: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), suscripción (formato: '/subscriptions/{subscriptionId}').
|
versionId
|
path |
True
|
string
|
Versión de la definición del plano técnico publicado.
|
api-version
|
query |
True
|
string
|
Versión de la API de cliente.
|
Respuestas
Nombre |
Tipo |
Description |
200 OK
|
Artifact:
|
Correcto: artefacto de la definición de plano técnico publicada recuperada.
|
Other Status Codes
|
CloudError
|
Respuesta de error de planos técnicos.
|
Seguridad
azure_auth
Flujo OAuth2 de Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nombre |
Description |
user_impersonation
|
suplantación de su cuenta de usuario
|
Ejemplos
MG-ARMTemplateArtifact
Sample Request
GET https://management.azure.com/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/versions/V2/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/SealedARMTemplateArtifact_Get.json
func ExamplePublishedArtifactsClient_Get_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.NewPublishedArtifactsClient().Get(ctx, "providers/Microsoft.Management/managementGroups/ContosoOnlineGroup", "simpleBlueprint", "V2", "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.PublishedArtifactsClientGetResponse{
// ArtifactClassification: &armblueprint.TemplateArtifact{
// Name: to.Ptr("storageTemplate"),
// Type: to.Ptr("Microsoft.Blueprint/blueprints/versions/artifacts"),
// ID: to.Ptr("/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/versions/V2/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.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/managementGroupBPDef/SealedARMTemplateArtifact_Get.json
// this example is just showing the usage of "PublishedArtifacts_Get" 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 PublishedBlueprintResource created on azure
// for more information of creating PublishedBlueprintResource, please refer to the document of PublishedBlueprintResource
string resourceScope = "providers/Microsoft.Management/managementGroups/ContosoOnlineGroup";
string blueprintName = "simpleBlueprint";
string versionId = "V2";
ResourceIdentifier publishedBlueprintResourceId = PublishedBlueprintResource.CreateResourceIdentifier(resourceScope, blueprintName, versionId);
PublishedBlueprintResource publishedBlueprint = client.GetPublishedBlueprintResource(publishedBlueprintResourceId);
// get the collection of this BlueprintVersionArtifactResource
BlueprintVersionArtifactCollection collection = publishedBlueprint.GetBlueprintVersionArtifacts();
// invoke the operation
string artifactName = "storageTemplate";
NullableResponse<BlueprintVersionArtifactResource> response = await collection.GetIfExistsAsync(artifactName);
BlueprintVersionArtifactResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// 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/versions/V2/artifacts/storageTemplate",
"type": "Microsoft.Blueprint/blueprints/versions/artifacts",
"name": "storageTemplate"
}
MG-PolicyAssignmentArtifact
Sample Request
GET https://management.azure.com/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/versions/V2/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/SealedPolicyAssignmentArtifact_Get.json
func ExamplePublishedArtifactsClient_Get_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.NewPublishedArtifactsClient().Get(ctx, "providers/Microsoft.Management/managementGroups/ContosoOnlineGroup", "simpleBlueprint", "V2", "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.PublishedArtifactsClientGetResponse{
// ArtifactClassification: &armblueprint.PolicyAssignmentArtifact{
// Name: to.Ptr("costCenterPolicy"),
// Type: to.Ptr("Microsoft.Blueprint/blueprints/versions/artifacts"),
// ID: to.Ptr("/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/versions/V2/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.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/managementGroupBPDef/SealedPolicyAssignmentArtifact_Get.json
// this example is just showing the usage of "PublishedArtifacts_Get" 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 PublishedBlueprintResource created on azure
// for more information of creating PublishedBlueprintResource, please refer to the document of PublishedBlueprintResource
string resourceScope = "providers/Microsoft.Management/managementGroups/ContosoOnlineGroup";
string blueprintName = "simpleBlueprint";
string versionId = "V2";
ResourceIdentifier publishedBlueprintResourceId = PublishedBlueprintResource.CreateResourceIdentifier(resourceScope, blueprintName, versionId);
PublishedBlueprintResource publishedBlueprint = client.GetPublishedBlueprintResource(publishedBlueprintResourceId);
// get the collection of this BlueprintVersionArtifactResource
BlueprintVersionArtifactCollection collection = publishedBlueprint.GetBlueprintVersionArtifacts();
// invoke the operation
string artifactName = "costCenterPolicy";
NullableResponse<BlueprintVersionArtifactResource> response = await collection.GetIfExistsAsync(artifactName);
BlueprintVersionArtifactResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// 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/versions/V2/artifacts/costCenterPolicy",
"type": "Microsoft.Blueprint/blueprints/versions/artifacts",
"name": "costCenterPolicy"
}
MG-RoleAssignmentArtifact
Sample Request
GET https://management.azure.com/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/versions/V2/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/SealedRoleAssignmentArtifact_Get.json
func ExamplePublishedArtifactsClient_Get_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.NewPublishedArtifactsClient().Get(ctx, "providers/Microsoft.Management/managementGroups/ContosoOnlineGroup", "simpleBlueprint", "V2", "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.PublishedArtifactsClientGetResponse{
// ArtifactClassification: &armblueprint.RoleAssignmentArtifact{
// Name: to.Ptr("ownerAssignment"),
// Type: to.Ptr("Microsoft.Blueprint/blueprints/versions/artifacts"),
// ID: to.Ptr("/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/versions/V2/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.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/managementGroupBPDef/SealedRoleAssignmentArtifact_Get.json
// this example is just showing the usage of "PublishedArtifacts_Get" 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 PublishedBlueprintResource created on azure
// for more information of creating PublishedBlueprintResource, please refer to the document of PublishedBlueprintResource
string resourceScope = "providers/Microsoft.Management/managementGroups/ContosoOnlineGroup";
string blueprintName = "simpleBlueprint";
string versionId = "V2";
ResourceIdentifier publishedBlueprintResourceId = PublishedBlueprintResource.CreateResourceIdentifier(resourceScope, blueprintName, versionId);
PublishedBlueprintResource publishedBlueprint = client.GetPublishedBlueprintResource(publishedBlueprintResourceId);
// get the collection of this BlueprintVersionArtifactResource
BlueprintVersionArtifactCollection collection = publishedBlueprint.GetBlueprintVersionArtifacts();
// invoke the operation
string artifactName = "ownerAssignment";
NullableResponse<BlueprintVersionArtifactResource> response = await collection.GetIfExistsAsync(artifactName);
BlueprintVersionArtifactResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// 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/versions/V2/artifacts/ownerAssignment",
"type": "Microsoft.Blueprint/blueprints/versions/artifacts",
"name": "ownerAssignment"
}
Sub-ARMTemplateArtifact
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/versions/V2/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/SealedARMTemplateArtifact_Get.json
func ExamplePublishedArtifactsClient_Get_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.NewPublishedArtifactsClient().Get(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "simpleBlueprint", "V2", "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.PublishedArtifactsClientGetResponse{
// ArtifactClassification: &armblueprint.TemplateArtifact{
// Name: to.Ptr("storageTemplate"),
// Type: to.Ptr("Microsoft.Blueprint/blueprints/versions/artifacts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/versions/V2/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.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/subscriptionBPDef/SealedARMTemplateArtifact_Get.json
// this example is just showing the usage of "PublishedArtifacts_Get" 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 PublishedBlueprintResource created on azure
// for more information of creating PublishedBlueprintResource, please refer to the document of PublishedBlueprintResource
string resourceScope = "subscriptions/00000000-0000-0000-0000-000000000000";
string blueprintName = "simpleBlueprint";
string versionId = "V2";
ResourceIdentifier publishedBlueprintResourceId = PublishedBlueprintResource.CreateResourceIdentifier(resourceScope, blueprintName, versionId);
PublishedBlueprintResource publishedBlueprint = client.GetPublishedBlueprintResource(publishedBlueprintResourceId);
// get the collection of this BlueprintVersionArtifactResource
BlueprintVersionArtifactCollection collection = publishedBlueprint.GetBlueprintVersionArtifacts();
// invoke the operation
string artifactName = "storageTemplate";
NullableResponse<BlueprintVersionArtifactResource> response = await collection.GetIfExistsAsync(artifactName);
BlueprintVersionArtifactResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// 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/versions/V2/artifacts/storageTemplate",
"type": "Microsoft.Blueprint/blueprints/versions/artifacts",
"name": "storageTemplate"
}
Sub-PolicyAssignmentArtifact
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/versions/V2/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/SealedPolicyAssignmentArtifact_Get.json
func ExamplePublishedArtifactsClient_Get_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.NewPublishedArtifactsClient().Get(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "simpleBlueprint", "V2", "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.PublishedArtifactsClientGetResponse{
// ArtifactClassification: &armblueprint.PolicyAssignmentArtifact{
// Name: to.Ptr("costCenterPolicy"),
// Type: to.Ptr("Microsoft.Blueprint/blueprints/versions/artifacts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/versions/V2/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.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/subscriptionBPDef/SealedPolicyAssignmentArtifact_Get.json
// this example is just showing the usage of "PublishedArtifacts_Get" 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 PublishedBlueprintResource created on azure
// for more information of creating PublishedBlueprintResource, please refer to the document of PublishedBlueprintResource
string resourceScope = "subscriptions/00000000-0000-0000-0000-000000000000";
string blueprintName = "simpleBlueprint";
string versionId = "V2";
ResourceIdentifier publishedBlueprintResourceId = PublishedBlueprintResource.CreateResourceIdentifier(resourceScope, blueprintName, versionId);
PublishedBlueprintResource publishedBlueprint = client.GetPublishedBlueprintResource(publishedBlueprintResourceId);
// get the collection of this BlueprintVersionArtifactResource
BlueprintVersionArtifactCollection collection = publishedBlueprint.GetBlueprintVersionArtifacts();
// invoke the operation
string artifactName = "costCenterPolicy";
NullableResponse<BlueprintVersionArtifactResource> response = await collection.GetIfExistsAsync(artifactName);
BlueprintVersionArtifactResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// 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/versions/V2/artifacts/costCenterPolicy",
"type": "Microsoft.Blueprint/blueprints/versions/artifacts",
"name": "costCenterPolicy"
}
Sub-RoleAssignmentArtifact
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/versions/V2/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/SealedRoleAssignmentArtifact_Get.json
func ExamplePublishedArtifactsClient_Get_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.NewPublishedArtifactsClient().Get(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", "simpleBlueprint", "V2", "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.PublishedArtifactsClientGetResponse{
// ArtifactClassification: &armblueprint.RoleAssignmentArtifact{
// Name: to.Ptr("ownerAssignment"),
// Type: to.Ptr("Microsoft.Blueprint/blueprints/versions/artifacts"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/versions/V2/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.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Blueprint;
// Generated from example definition: specification/blueprint/resource-manager/Microsoft.Blueprint/preview/2018-11-01-preview/examples/subscriptionBPDef/SealedRoleAssignmentArtifact_Get.json
// this example is just showing the usage of "PublishedArtifacts_Get" 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 PublishedBlueprintResource created on azure
// for more information of creating PublishedBlueprintResource, please refer to the document of PublishedBlueprintResource
string resourceScope = "subscriptions/00000000-0000-0000-0000-000000000000";
string blueprintName = "simpleBlueprint";
string versionId = "V2";
ResourceIdentifier publishedBlueprintResourceId = PublishedBlueprintResource.CreateResourceIdentifier(resourceScope, blueprintName, versionId);
PublishedBlueprintResource publishedBlueprint = client.GetPublishedBlueprintResource(publishedBlueprintResourceId);
// get the collection of this BlueprintVersionArtifactResource
BlueprintVersionArtifactCollection collection = publishedBlueprint.GetBlueprintVersionArtifacts();
// invoke the operation
string artifactName = "ownerAssignment";
NullableResponse<BlueprintVersionArtifactResource> response = await collection.GetIfExistsAsync(artifactName);
BlueprintVersionArtifactResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// 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/versions/V2/artifacts/ownerAssignment",
"type": "Microsoft.Blueprint/blueprints/versions/artifacts",
"name": "ownerAssignment"
}
Definiciones
CloudError
Nombre |
Tipo |
Description |
error
|
ErrorResponse
|
Respuesta de error
Respuesta de error común para todas las API de Azure Resource Manager para devolver los detalles de error de las operaciones con errores. (Esto también sigue el formato de respuesta de error de OData).
|
ErrorAdditionalInfo
Información adicional sobre el error de administración de recursos.
Nombre |
Tipo |
Description |
info
|
object
|
Información adicional.
|
type
|
string
|
Tipo de información adicional.
|
ErrorResponse
Respuesta de error
Nombre |
Tipo |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
Información adicional del error.
|
code
|
string
|
Código de error.
|
details
|
ErrorResponse[]
|
Los detalles del error.
|
message
|
string
|
El mensaje de error.
|
target
|
string
|
Destino del error.
|
keyVaultReference
Especifica el vínculo a un Key Vault.
Nombre |
Tipo |
Description |
id
|
string
|
Identificador de recurso de Azure del Key Vault.
|
ParameterValue
Valor del parámetro especificado. Puede ser "value" o "reference", pero no ambos.
Nombre |
Tipo |
Description |
reference
|
SecretValueReference
|
Valor de parámetro como tipo de referencia.
|
value
|
object
|
Valor del parámetro. Se permite cualquier valor JSON válido, incluidos objetos, matrices, cadenas, números y booleanos.
|
PolicyAssignmentArtifact
Artefacto de plano técnico que aplica una asignación de directiva.
Nombre |
Tipo |
Description |
id
|
string
|
Identificador de cadena que se usa para buscar cualquier recurso en Azure.
|
kind
|
string:
policyAssignment
|
Especifica el tipo de artefacto de plano técnico.
|
name
|
string
|
Nombre de este recurso.
|
properties.dependsOn
|
string[]
|
Artefactos que deben implementarse antes del artefacto especificado.
|
properties.description
|
string
|
Explicar este recurso en varias líneas.
|
properties.displayName
|
string
|
Una cadena de línea explica este recurso.
|
properties.parameters
|
<string,
ParameterValue>
|
Valores de parámetro para la definición de directiva.
|
properties.policyDefinitionId
|
string
|
Identificador de recurso de Azure de la definición de directiva.
|
properties.resourceGroup
|
string
|
Nombre del marcador de posición del grupo de recursos al que se asignará la directiva.
|
type
|
string
|
Tipo de este recurso.
|
RoleAssignmentArtifact
Artefacto de plano técnico que aplica una asignación de roles.
Nombre |
Tipo |
Description |
id
|
string
|
Identificador de cadena que se usa para buscar cualquier recurso en Azure.
|
kind
|
string:
roleAssignment
|
Especifica el tipo de artefacto de plano técnico.
|
name
|
string
|
Nombre de este recurso.
|
properties.dependsOn
|
string[]
|
Artefactos que deben implementarse antes del artefacto especificado.
|
properties.description
|
string
|
Explicar este recurso en varias líneas.
|
properties.displayName
|
string
|
Una cadena de línea explica este recurso.
|
properties.principalIds
|
|
Matriz de identidades de usuario o grupo en Azure Active Directory. RoleDefinition se aplicará a cada identidad.
|
properties.resourceGroup
|
string
|
RoleAssignment será el ámbito de este resourceGroup. Si está vacío, se limita a la suscripción.
|
properties.roleDefinitionId
|
string
|
Identificador de recurso de Azure de RoleDefinition.
|
type
|
string
|
Tipo de este recurso.
|
SecretValueReference
Referencia a un secreto de Key Vault.
Nombre |
Tipo |
Description |
keyVault
|
keyVaultReference
|
Especifica la referencia a una Key Vault de Azure determinada.
|
secretName
|
string
|
Nombre del secreto.
|
secretVersion
|
string
|
Versión del secreto que se va a usar. Si se deja en blanco, se usa la versión más reciente del secreto.
|
TemplateArtifact
Artefacto de plano técnico que implementa una plantilla de Resource Manager.
Nombre |
Tipo |
Description |
id
|
string
|
Identificador de cadena que se usa para buscar cualquier recurso en Azure.
|
kind
|
string:
template
|
Especifica el tipo de artefacto de plano técnico.
|
name
|
string
|
Nombre de este recurso.
|
properties.dependsOn
|
string[]
|
Artefactos que deben implementarse antes del artefacto especificado.
|
properties.description
|
string
|
Explicar este recurso en varias líneas.
|
properties.displayName
|
string
|
Una cadena de línea explica este recurso.
|
properties.parameters
|
<string,
ParameterValue>
|
Resource Manager valores de parámetro de artefacto de plano técnico de plantilla.
|
properties.resourceGroup
|
string
|
Si procede, el nombre del marcador de posición del grupo de recursos en el que se implementará el artefacto de plano técnico de plantilla de Resource Manager.
|
properties.template
|
object
|
Cuerpo del artefacto del plano técnico de la plantilla de Resource Manager.
|
type
|
string
|
Tipo de este recurso.
|