SlingShot is a service that enable one click deploy your web app from your repository to Azure App Service
All you need to do is place below markdown to your README.md file.
[](https://azuredeploy.net/)
or HTML if you like
<a href="https://azuredeploy.net/" target="_blank">
<img src="https://azuredeploy.net/deploybutton.svg"/>
</a>
Behind the scene, azuredeploy.net get the repository url from referal url and redirect request to deploy.azure.com. And some of the query strings from repository url will be honored. We can utilize these query strings for advance configuration.
- Deploy with linking paramater (Only if there is a azuredeploy.json at the root of your repository)
- Query string "ptmpl" : any public url pointing to parameter json file or relative path from current repository
[](https://deploy.azure.com/?repository={your repo url}?ptmpl={url to paramter json file or relative path from current repo})
e.g
[](https://deploy.azure.com/?repository=https://github.com/shrimpy/ArmParamterTemplateTest?ptmpl=https://raw.githubusercontent.com/shrimpy/ArmParamterTemplateTest/master/parameters.azuredeploy.json)
[](https://deploy.azure.com/?repository=https://github.com/shrimpy/ArmParamterTemplateTest?ptmpl=parameters.azuredeploy.json)
- Deploy with linking paramater (Only if there is a azuredeploy.json at the root of your repository)
- Query string "ptmpl" : any public url pointing to parameter json file or relative path from current repository
[](https://deploy.azure.com/?repository={your repo url}?ptmpl={url to paramter json file or relative path from current repo})
e.g
[](https://localhost:44300/?repository=https://bitbucket.org/shrimpywu/armparametertemplatetest?ptmpl=https://bitbucket.org/shrimpywu/armparametertemplatetest/raw/master/parameters.azuredeploy.json)
[](https://localhost:44300/?repository=https://bitbucket.org/shrimpywu/armparametertemplatetest?ptmpl=parameters.azuredeploy.json)
- Deploy from a pull request
- Query string "pr" : pull request id
[](https://localhost:44300/?repository={repository url}?pr={pull request id})
e.g
[](https://localhost:44300/?repository=https://bitbucket.org/shrimpywu/armparametertemplatetest?pr=1)
- Enable continues deployment
- Query string "manual" : true/false, default is false. Require single-sign-on with Azure.
[](https://localhost:44300/?repository={repository url}?manual={true/false})
e.g
[](https://localhost:44300/?repository=https://bitbucket.org/shrimpywu/armparametertemplatetest?manual=true)
- Combine query strings
[](https://localhost:44300/?repository=https://bitbucket.org/shrimpywu/armparametertemplatetest?ptmpl=https://bitbucket.org/shrimpywu/armparametertemplatetest/raw/master/parameters.azuredeploy.json&pr=1)
- Clone this repository to your local drive.
- Open
slingshot.sln
with VS 2012+ and compile.
- Go to Azure Portal while logged in as an Org ID (i.e. not MSA) and create AAD Application. You may create an application on existing AAD directory or a new directory altogether.
- Select
Add an application my organization is developing
- Enter any name for application name.
- Select
WEB APPLICATION AND/OR WEB API
- Enter
https://localhost:44306/
asSIGN ON URL
- For
APP ID URL
, enter something likehttps://davidebboslingshot.onmicrosoft.com/
. - Once created, click
CONFIGURE
tab - On
Permission to other applications
, addWindows Azure Service Management API
and checkAccess Azure Service Management
forDelegated Permissions
and save.
- Copy
CLIENT ID
and paste it in this line, replacingEnvironment.GetEnvironmentVariable("AADClientId")
. - On
Keys
section, create a client secret. Copy the key and paste it in the same file, replacingEnvironment.GetEnvironmentVariable("AADClientSecret")
.
Or as a cleaner alternative, you can set the AADClientId
and AADClientSecret
environment variables on your machine so that the code picks it up without having to modify it.
- In VS, make Slingshot.Api the starter project. The RedirectionSite project can be ignored.
- Starting running it in the debugger (F5).
- In browser, it should redirect to login page.
- Enter AAD account and password. Note: try account that is not in the same directly as the application. Note: currently this does not work with MSA account.
- You should be prompt with OAuth allow/deny page, do accept it.
https://localhost:44306/api/token
- show current token details.https://localhost:44306/api/tenants
- show all tenants (AAD directory) user belongs to.https://localhost:44306/api/tenants/<tenant-id>
- to switch tenant.https://localhost:44306/api/subscriptions
- list subscriptions.https://localhost:44306/api/subscriptions/<sub-id>/resourceGroups
- list resourceGroups for a subscription.https://localhost:44306/api/subscriptions/<sub-id>/resourceGroups/<resource>/providers/Microsoft.Web/sites
- list sites.- and so on..
- Create Azure Websites with local git publishing enabled
- Add the site https url as the reply URL for AAD application
- Deploy the website by pushing the repository
- Set AADClientID and AADClientSecret appSettings
- To test, simply browse to the website and append the query string "?repository="
Any issue, do let me know.