Updated sample based on azure-quickstart

Removed complete PowerShell script
Added description for deploy to private storage account
This commit is contained in:
Marc van Eijk 2016-07-05 15:11:46 +02:00
Родитель 5576289ed8
Коммит 938e4bb52b
1 изменённых файлов: 48 добавлений и 70 удалений

Просмотреть файл

@ -1,9 +1,13 @@
# [Solution name]
# Solution name
<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F101-vnet-two-subnets%2Fazuredeploy.json" target="_blank">
<img src="http://azuredeploy.net/deploybutton.png"/></a>
<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F100-STARTER-TEMPLATE-with-VALIDATION%2Fazuredeploy.json" target="_blank">
<img src="http://azuredeploy.net/deploybutton.png"/>
</a>
<a href="http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F100-STARTER-TEMPLATE-with-VALIDATION%2Fazuredeploy.json" target="_blank">
<img src="http://armviz.io/visualizebutton.png"/>
</a>
This template deploys a [solution name]. The [solution name] is a [description]
This template deploys a **solution name**. The **solution name** is a **description**
`Tags: [Tag1, Tag2, Tag3]`
@ -12,92 +16,66 @@ This template deploys a [solution name]. The [solution name] is a [description]
| Microsoft Azure | - | no |
| Microsoft Azure Stack | TP1 | no |
## Deployed resources
## Solution overview and deployed resources
This is an overview of the solution
The following resources are deployed as part of the solution
####[Resource provider 1]
[Description Resource Provider 1]
+ **[Resource type 1A]**: [Description Resource type 1A]
+ **[Resource type 1B]**: [Description Resource type 1B]
+ **[Resource type 1C]**: [Description Resource type 1C]
#### Resource provider 1
####[Resource provider 2]
[Description Resource Provider 2]
+ **[Resource type 2A]**: [Description Resource type 2A]
Description Resource Provider 1
####[Resource provider 3]
[Description Resource Provider 3]
+ **[Resource type 3A]**: [Description Resource type 3A]
+ **[Resource type 3B]**: [Description Resource type 3B]
+ **Resource type 1A**: Description Resource type 1A
+ **Resource type 1B**: Description Resource type 1B
+ **Resource type 1C**: Description Resource type 1C
#### Resource provider 2
Description Resource Provider 2
+ **Resource type 2A**: Description Resource type 2A
#### Resource provider 3
Description Resource Provider 3
+ **Resource type 3A**: Description Resource type 3A
+ **Resource type 3B**: Description Resource type 3B
## Prerequisites
[Decscription of the prerequistes for the deployment]
Decscription of the prerequistes for the deployment
## Deployment steps
You can either click the "deploy to Azure" button at the beginning of this document or deploy the solution from PowerShell with the following PowerShell script.
``` PowerShell
## Specify your AzureAD Tenant in a variable.
# If you know the prefix of your <prefix>.onmicrosoft.com AzureAD account use option 1)
# If you do not know the prefix of your <prefix>.onmicrosoft.com AzureAD account use option 2)
You can click the "deploy to Azure" button at the beginning of this document or follow the instructions for command line deployment using the scripts in the root of this repo.
# Option 1) If you know the prefix of your <prefix>.onmicrosoft.com AzureAD namespace.
# You need to set that in the $AadTenantId varibale (e.g. contoso.onmicrosoft.com).
$AadTenantId = "contoso"
It is also possible to create a storage account in your subscription and perform the deployment from that storage account using the following steps.
To deploy this template using the scripts from the root of this repo: (change the folder name below to match the folder name for this sample)
# Option 2) If you don't know the prefix of your AzureAD namespace, run the following cmdlets.
# Validate with the Azure AD credentials you also use to sign in as a tenant to Microsoft Azure Stack Technical Preview.
$AadTenant = Login-AzureRmAccount
$AadTenantId = $AadTenant.Context.Tenant.TenantId
```PowerShell
.\Deploy-AzureResourceGroup.ps1 -ResourceGroupLocation 'local' -ArtifactsStagingDirectory '[foldername]'
```
## Configure the environment with the Add-AzureRmEnvironment cmdlt
Add-AzureRmEnvironment -Name 'Azure Stack' `
-ActiveDirectoryEndpoint ("https://login.windows.net/$AadTenantId/") `
-ActiveDirectoryServiceEndpointResourceId "https://azurestack.local-api/"`
-ResourceManagerEndpoint ("https://api.azurestack.local/") `
-GalleryEndpoint ("https://gallery.azurestack.local/") `
-GraphEndpoint "https://graph.windows.net/"
If your sample has artifacts that need to be "staged" for deployment (Configuration Scripts, Nested Templates, DSC Packages) then set the upload switch on the command.
You can optionally specify a storage account to use, if so the storage account must already exist within the subscription. If you don't want to specify a storage account
one will be created by the script (think of this as "temp" storage for AzureRM) and reused by subsequent deployments.
## Authenticate a user to the environment (you will be prompted during authentication)
$privateEnv = Get-AzureRmEnvironment 'Azure Stack'
$privateAzure = Add-AzureRmAccount -Environment $privateEnv -Verbose
Select-AzureRmProfile -Profile $privateAzure
## Select an existing subscription where the deployment will take place
Get-AzureRmSubscription -SubscriptionName "SUBSCRIPTION_NAME" | Select-AzureRmSubscription
# Set Deployment Variables
$myNum = "001" #Modify this per deployment
$RGName = "myRG$myNum"
$myLocation = "local"
$myBlobStorageEndpoint = "blob.azurestack.local"
# Create Resource Group for Template Deployment
New-AzureRmResourceGroup -Name $RGName -Location $myLocation
# Deploy Template
New-AzureRmResourceGroupDeployment `
-Name "myDeployment$myNum" `
-ResourceGroupName $RGName `
-TemplateFile "c:\templates\azuredeploy-101-simple-windows-vm-withDNS.json" `
-deploymentLocation $myLocation `
-blobStorageEndpoint $myBlobStorageEndpoint `
-newStorageAccountName "mystorage$myNum" `
-dnsNameForPublicIP "mydns$myNum" `
-adminUsername "admin" `
-adminPassword ("User@123" | ConvertTo-SecureString -AsPlainText -Force) `
-vmName "myVM$myNum" `
-windowsOSVersion "2012-R2-Datacenter"
```PowerShell
.\Deploy-AzureResourceGroup.ps1 -ResourceGroupLocation 'local' -ArtifactsStagingDirectory '100-STARTER-TEMPLATE-with-VALIDATION' -UploadArtifacts
```
## Usage
#### Connect
[How to connect to the solution]
How to connect to the solution
#### Management
[How to manage the solution]
How to manage the solution
## Notes
[Solution notes]
Solution notes