Comments (6)
Based on my research, there's no reliable way to discover the storage endpoint suffix or key vault suffix, so we will still need to require the admin to manually specify those values.
We could do a "blend" of trying to discover, and falling back to requiring the values to be manually specified if they can't be determined.
A possible way to discover these is by looking at storage account info via ARM at /subscriptions/<subscription ID>/resourceGroups/<resource group name>/providers/Microsoft.Storage/storageaccounts
and looking a the URL suffixes of primaryEndpoints
. However if there's no storage accounts, this obviously won't work :)
Same goes for Key Vaults, which could be listed at /subscriptions/<subscription ID>/resourceGroups/<resource group name>/providers/Microsoft.KeyVault/vaults
and looking at the suffix of the vaultUri
.
Example storage acct JSON:
{
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"kind": "Storage",
"id": "/subscriptions/ca3444ad-9e61-4360-85f6-fc71368a73e4/resourcegroups/resourcegroup/providers/Microsoft.Storage/storageaccounts/storageacct",
"type": "Microsoft.Storage/storageaccounts",
"name": "storageacct",
"location": "westus",
"properties": {
"provisioningState": "Succeeded",
"primaryEndpoints": {
"blob": "https://storageacct.blob.westus.stackpoc.com/",
"queue": "https://storageacct.queue.westus.stackpoc.com/",
"table": "https://storageacct.table.westus.stackpoc.com/"
},
"primaryLocation": "westus",
"statusOfPrimary": "Available",
"encryption": {
"services": {
"blob": {
"enabled": true,
"lastEnabledTime": "2018-03-29T14:53:30.9400000"
}
},
"keySource": "Microsoft.Storage"
},
"creationTime": "2018-03-29T14:53:30.9400000"
}
}
Example Vault JSON:
{
"id": "/subscriptions/ca3444ad-9e61-4360-85f6-fc71368a73e4/resourceGroups/resourcegroup/providers/Microsoft.KeyVault/vaults/vault",
"name": "vault",
"type": "Microsoft.KeyVault/vaults",
"location": "westus",
"tags": {},
"properties": {
"sku": {
"family": "A",
"name": "Standard"
},
"tenantId": "a3f33ab9-6362-4609-b44d-a669107ebd9d",
"accessPolicies": [
{
"tenantId": "a3f33ab9-6362-4609-b44d-a669107ebd9d",
"objectId": "7ad1f39b-75d9-48ba-9ff7-7158c6a4b9b3",
"permissions": {
"keys": [
"Get",
"List",
"Update",
"Create",
"Import",
"Delete",
"Recover",
"Backup",
"Restore"
],
"secrets": [
"Get",
"List",
"Set",
"Delete",
"Recover",
"Backup",
"Restore"
],
"certificates": [
"Get",
"List",
"Update",
"Create",
"Import",
"Delete",
"Recover",
"ManageContacts",
"ManageIssuers",
"GetIssuers",
"ListIssuers",
"SetIssuers",
"DeleteIssuers"
]
}
}
],
"enabledForDeployment": false,
"enabledForDiskEncryption": false,
"enabledForTemplateDeployment": false,
"vaultUri": "https://vault.vault.westus.stackpoc.com/"
}
}
from azure-armrest.
We can discover supported API versions/API profiles using ARM as well, using /providers/<provider type>
, for example, here's a snip of the JSON for /providers/Microsoft.Network
:
{
"namespace": "Microsoft.Network",
"resourceTypes": [
{
"resourceType": "connections",
"locations": [
"westus"
],
"apiVersions": [
"2015-06-15",
"2015-05-01-preview"
],
"apiProfiles": [
{
"profileVersion": "2017-03-09-profile",
"apiVersion": "2015-06-15"
}
]
},
{
"resourceType": "loadBalancers",
"locations": [
"westus"
],
"apiVersions": [
"2015-06-15",
"2015-05-01-preview"
],
"apiProfiles": [
{
"profileVersion": "2017-03-09-profile",
"apiVersion": "2015-06-15"
}
]
},
from azure-armrest.
@bsquizz The library will automatically determine the latest api-version for each service. For manageiq, we'll need to decide on the semantics. At the moment it looks like this:
:ems:
:ems_azure:
:api_versions:
:availability_set: "2017-12-01"
:ip_address: "2017-11-01"
As I mentioned on the call, I'm thinking we change it to something like this:
:ems:
:ems_azure:
:default
:api_versions:
:availability_set: "2017-12-01"
:ip_address: "2017-11-01"
:your_provider
:availability_set: "2016-11-30" # or whatever
:ip_address: "2016-07-30" # ditto
If the provider name matches a config entry, we use those api-version strings. Otherwise we use the default settings.
from azure-armrest.
@bsquizz Let's take the discussion on how to handle this over at the Azure provider repo. For now, as long as the gem has the ability to autodiscover, we can close this issue.
Once the PR is merged, I can push out a new version of the gem, and update the gemspec, and we can start using the new methods.
from azure-armrest.
Sure, that's fine, just wanted to collect all 'discovery' related info I had looked into here in 1 place. I wasn't 100% certain if we did the version discovery or not.
from azure-armrest.
Now part of 0.9.11, which is also set in the current azure provider gemspec.
from azure-armrest.
Related Issues (20)
- Remove Nokogiri, use REXML HOT 2
- StorageAccountService#list_all_private_images results in Errno::ECONNREFUSED HOT 2
- Marketplace Image Support HOT 1
- Switch from rest-client to excon HOT 1
- VirtualMachineImageService#list_all is very slow HOT 1
- Add friendlier handling of 429 and 50x errors HOT 1
- Refactor request methods into a module HOT 1
- StorageAccount#all_blobs consumes lots of memory HOT 1
- Some current test failures on Windows HOT 5
- Test failures on Windows HOT 1
- next_marker_results is busted HOT 1
- VirtualMachineService#delete_associated_resources does not handle managed disks HOT 1
- StorageAccount#table_data with :all option is busted HOT 2
- Update rest-client to 2.1.0 HOT 1
- Metrics collection needs to be updated HOT 1
- Azure-armrest fails to properly handle application/xml exceptions
- Parallel dependency 5y old HOT 7
- Get Subscription Usage cost (monthly) HOT 8
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-armrest.