From dbc2d56d3b6b98e5e9327914d77b2bddc31d1e0b Mon Sep 17 00:00:00 2001 From: Sathish Date: Fri, 1 Oct 2021 21:25:45 +0530 Subject: [PATCH 1/9] support power BI gateway(s) Signed-off-by: Sathish --- libraries/azure_power_bi_gateway.rb | 1 + libraries/azure_power_bi_gateways.rb | 1 + 2 files changed, 2 insertions(+) create mode 100644 libraries/azure_power_bi_gateway.rb create mode 100644 libraries/azure_power_bi_gateways.rb diff --git a/libraries/azure_power_bi_gateway.rb b/libraries/azure_power_bi_gateway.rb new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/libraries/azure_power_bi_gateway.rb @@ -0,0 +1 @@ + diff --git a/libraries/azure_power_bi_gateways.rb b/libraries/azure_power_bi_gateways.rb new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/libraries/azure_power_bi_gateways.rb @@ -0,0 +1 @@ + From 497b84a13f2808c46f2cdf6a858a65b6a239473c Mon Sep 17 00:00:00 2001 From: Sathish Date: Fri, 1 Oct 2021 21:25:54 +0530 Subject: [PATCH 2/9] unit test power BI gateway(s) Signed-off-by: Sathish --- test/unit/resources/azure_power_bi_gateway_test.rb | 1 + test/unit/resources/azure_power_bi_gateways_test.rb | 1 + 2 files changed, 2 insertions(+) create mode 100644 test/unit/resources/azure_power_bi_gateway_test.rb create mode 100644 test/unit/resources/azure_power_bi_gateways_test.rb diff --git a/test/unit/resources/azure_power_bi_gateway_test.rb b/test/unit/resources/azure_power_bi_gateway_test.rb new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/test/unit/resources/azure_power_bi_gateway_test.rb @@ -0,0 +1 @@ + diff --git a/test/unit/resources/azure_power_bi_gateways_test.rb b/test/unit/resources/azure_power_bi_gateways_test.rb new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/test/unit/resources/azure_power_bi_gateways_test.rb @@ -0,0 +1 @@ + From f3c87a49917f110af1d7204a5ec2b958f5eafa9b Mon Sep 17 00:00:00 2001 From: Sathish Date: Fri, 1 Oct 2021 21:26:02 +0530 Subject: [PATCH 3/9] integral test power BI gateway(s) Signed-off-by: Sathish --- test/integration/verify/controls/azure_power_bi_gateway.rb | 1 + test/integration/verify/controls/azure_power_bi_gateways.rb | 1 + 2 files changed, 2 insertions(+) create mode 100644 test/integration/verify/controls/azure_power_bi_gateway.rb create mode 100644 test/integration/verify/controls/azure_power_bi_gateways.rb diff --git a/test/integration/verify/controls/azure_power_bi_gateway.rb b/test/integration/verify/controls/azure_power_bi_gateway.rb new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/test/integration/verify/controls/azure_power_bi_gateway.rb @@ -0,0 +1 @@ + diff --git a/test/integration/verify/controls/azure_power_bi_gateways.rb b/test/integration/verify/controls/azure_power_bi_gateways.rb new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/test/integration/verify/controls/azure_power_bi_gateways.rb @@ -0,0 +1 @@ + From c11022505dab1268ca7815e6ad3e85e5a60f5080 Mon Sep 17 00:00:00 2001 From: Sathish Date: Fri, 1 Oct 2021 21:26:11 +0530 Subject: [PATCH 4/9] document power BI gateway(s) Signed-off-by: Sathish --- docs/resources/azure_power_bi_gateway.md | 0 docs/resources/azure_power_bi_gateways.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/resources/azure_power_bi_gateway.md create mode 100644 docs/resources/azure_power_bi_gateways.md diff --git a/docs/resources/azure_power_bi_gateway.md b/docs/resources/azure_power_bi_gateway.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/resources/azure_power_bi_gateways.md b/docs/resources/azure_power_bi_gateways.md new file mode 100644 index 000000000..e69de29bb From 3dc286e1f75e66ceabd05e90ac1a4de5cc15cdf1 Mon Sep 17 00:00:00 2001 From: Sathish Date: Tue, 5 Oct 2021 09:52:49 +0530 Subject: [PATCH 5/9] update libraries Signed-off-by: Sathish --- libraries/azure_power_bi_gateway.rb | 36 +++++++++++++++++++++++++ libraries/azure_power_bi_gateways.rb | 40 ++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/libraries/azure_power_bi_gateway.rb b/libraries/azure_power_bi_gateway.rb index 8b1378917..1f83de022 100644 --- a/libraries/azure_power_bi_gateway.rb +++ b/libraries/azure_power_bi_gateway.rb @@ -1 +1,37 @@ +require 'azure_generic_resource' +class AzurePowerBIGateway < AzureGenericResource + name 'azure_power_bi_gateway' + desc 'Retrieves and verifies the settings of a Azure Power BI Gateway' + example <<-EXAMPLE + describe azure_power_bi_gateway(dashboard_id: '95a4871a-33a4-4f35', group_id: '95a4871a-33a4-4f35-9eea-8ff006b4840b') do + it { should exist } + end + EXAMPLE + + attr_reader :table + + AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + + def initialize(opts = {}) + raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + + Validators.validate_parameters(resource_name: @__resource_name__, required: %i(dashboard_id), + allow: %i(group_id), + opts: opts) + + opts[:name] = opts.delete(:dashboard_id) + opts[:resource_uri] = ['https://api.powerbi.com/v1.0/myorg'].tap do |arr| + arr << "gateways/#{opts[:name]}" + end.join('/') + opts[:audience] = AUDIENCE + opts[:add_subscription_id] = false + opts[:is_uri_a_url] = true + opts[:api_version] = 'v1.0' + super + end + + def to_s + super(AzurePowerBIGateway) + end +end diff --git a/libraries/azure_power_bi_gateways.rb b/libraries/azure_power_bi_gateways.rb index 8b1378917..20e8da7c2 100644 --- a/libraries/azure_power_bi_gateways.rb +++ b/libraries/azure_power_bi_gateways.rb @@ -1 +1,41 @@ +require 'azure_generic_resources' +class AzurePowerBIGateways < AzureGenericResources + name 'azure_power_bi_gateways' + desc 'Retrieves and verifies the settings of all Azure Power BI Gateways.' + example <<-EXAMPLE + describe azure_power_bi_gateways do + it { should exist } + end + EXAMPLE + + AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + + def initialize(opts = {}) + raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + + opts[:resource_uri] = ['https://api.powerbi.com/v1.0/myorg'].tap do |arr| + arr << 'gateways' + end.join('/') + opts[:audience] = AUDIENCE + opts[:add_subscription_id] = false + opts[:is_uri_a_url] = true + opts[:api_version] = 'v1.0' + super + return if failed_resource? + + populate_filter_table_from_response + end + + def to_s + super(AzurePowerBiGateways) + end + + private + + def populate_table + @resources.each do |resource| + @table << resource.merge(resource[:publicKey]) + end + end +end From 77d930a38bcfe3136810190eab453c67d81016d0 Mon Sep 17 00:00:00 2001 From: Sathish Date: Tue, 5 Oct 2021 09:53:54 +0530 Subject: [PATCH 6/9] update tests Signed-off-by: Sathish --- .../verify/controls/azure_power_bi_gateway.rb | 9 +++++++- .../controls/azure_power_bi_gateways.rb | 8 ++++++- .../resources/azure_power_bi_gateway_test.rb | 16 ++++++++++++++ .../resources/azure_power_bi_gateways_test.rb | 22 +++++++++++++++++++ 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/test/integration/verify/controls/azure_power_bi_gateway.rb b/test/integration/verify/controls/azure_power_bi_gateway.rb index 8b1378917..8648c864b 100644 --- a/test/integration/verify/controls/azure_power_bi_gateway.rb +++ b/test/integration/verify/controls/azure_power_bi_gateway.rb @@ -1 +1,8 @@ - +gateway_id = input(:gateway_id, value: '') +control 'Verify settings of a Power BI Dashboard' do + describe azure_power_bi_gateway(gateway_id: gateway_id) do + it { should exist } + its('type') { should eq 'Resource' } + its('publicKey.exponent') { should eq 'AQAB' } + end +end diff --git a/test/integration/verify/controls/azure_power_bi_gateways.rb b/test/integration/verify/controls/azure_power_bi_gateways.rb index 8b1378917..df20edaa9 100644 --- a/test/integration/verify/controls/azure_power_bi_gateways.rb +++ b/test/integration/verify/controls/azure_power_bi_gateways.rb @@ -1 +1,7 @@ - +control 'verify settings of Power BI Gateways' do + describe azure_power_bi_gateways do + it { should exist } + its('types') { should include 'Resource' } + its('exponents') { should include 'AQAB' } + end +end diff --git a/test/unit/resources/azure_power_bi_gateway_test.rb b/test/unit/resources/azure_power_bi_gateway_test.rb index 8b1378917..43c30cdf7 100644 --- a/test/unit/resources/azure_power_bi_gateway_test.rb +++ b/test/unit/resources/azure_power_bi_gateway_test.rb @@ -1 +1,17 @@ +require_relative 'helper' +require 'azure_power_bi_gateway' +class AzurePowerBIGatewayConstructorTest < Minitest::Test + def test_empty_param_not_ok + assert_raises(ArgumentError) { AzurePowerBIGateway.new } + end + + # resource_provider should not be allowed. + def test_resource_provider_not_ok + assert_raises(ArgumentError) { AzurePowerBIGateway.new(resource_provider: 'some_type') } + end + + def test_resource_group_name_alone_ok + assert_raises(ArgumentError) { AzurePowerBIGateway.new(name: 'my-name', resource_group: 'test') } + end +end diff --git a/test/unit/resources/azure_power_bi_gateways_test.rb b/test/unit/resources/azure_power_bi_gateways_test.rb index 8b1378917..ce911f31e 100644 --- a/test/unit/resources/azure_power_bi_gateways_test.rb +++ b/test/unit/resources/azure_power_bi_gateways_test.rb @@ -1 +1,23 @@ +require_relative 'helper' +require 'azure_power_bi_gateways' + +class AzurePowerBIGatewaysConstructorTest < Minitest::Test + # resource_type should not be allowed. + + def test_resource_type_not_ok + assert_raises(ArgumentError) { AzurePowerBIGateways.new(resource_provider: 'some_type') } + end + + def tag_value_not_ok + assert_raises(ArgumentError) { AzurePowerBIGateways.new(tag_value: 'some_tag_value') } + end + + def tag_name_not_ok + assert_raises(ArgumentError) { AzurePowerBIGateways.new(tag_name: 'some_tag_name') } + end + + def test_name_not_ok + assert_raises(ArgumentError) { AzurePowerBIGateways.new(name: 'some_name') } + end +end From 16106aadb964570f187bf2a178ee224b6fe233b4 Mon Sep 17 00:00:00 2001 From: Sathish Date: Tue, 5 Oct 2021 10:28:30 +0530 Subject: [PATCH 7/9] fix typos Signed-off-by: Sathish --- libraries/azure_power_bi_gateway.rb | 11 ++++------- libraries/azure_power_bi_gateways.rb | 6 ++---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/libraries/azure_power_bi_gateway.rb b/libraries/azure_power_bi_gateway.rb index 1f83de022..575639817 100644 --- a/libraries/azure_power_bi_gateway.rb +++ b/libraries/azure_power_bi_gateway.rb @@ -4,7 +4,7 @@ class AzurePowerBIGateway < AzureGenericResource name 'azure_power_bi_gateway' desc 'Retrieves and verifies the settings of a Azure Power BI Gateway' example <<-EXAMPLE - describe azure_power_bi_gateway(dashboard_id: '95a4871a-33a4-4f35', group_id: '95a4871a-33a4-4f35-9eea-8ff006b4840b') do + describe azure_power_bi_gateway(gateway_id: '95a4871a-33a4-4f35-9eea-8ff006b4840b') do it { should exist } end EXAMPLE @@ -16,14 +16,11 @@ class AzurePowerBIGateway < AzureGenericResource def initialize(opts = {}) raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - Validators.validate_parameters(resource_name: @__resource_name__, required: %i(dashboard_id), - allow: %i(group_id), + Validators.validate_parameters(resource_name: @__resource_name__, required: %i(gateway_id), opts: opts) - opts[:name] = opts.delete(:dashboard_id) - opts[:resource_uri] = ['https://api.powerbi.com/v1.0/myorg'].tap do |arr| - arr << "gateways/#{opts[:name]}" - end.join('/') + opts[:name] = opts.delete(:gateway_id) + opts[:resource_uri] = "https://api.powerbi.com/v1.0/myorg/gateways/#{opts[:name]}" opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true diff --git a/libraries/azure_power_bi_gateways.rb b/libraries/azure_power_bi_gateways.rb index 20e8da7c2..d423d6a05 100644 --- a/libraries/azure_power_bi_gateways.rb +++ b/libraries/azure_power_bi_gateways.rb @@ -14,9 +14,7 @@ class AzurePowerBIGateways < AzureGenericResources def initialize(opts = {}) raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - opts[:resource_uri] = ['https://api.powerbi.com/v1.0/myorg'].tap do |arr| - arr << 'gateways' - end.join('/') + opts[:resource_uri] = 'https://api.powerbi.com/v1.0/myorg/gateways' opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true @@ -28,7 +26,7 @@ def initialize(opts = {}) end def to_s - super(AzurePowerBiGateways) + super(AzurePowerBIGateways) end private From b5bbe72b3c7b498567609e6f2a1535df3e3f155f Mon Sep 17 00:00:00 2001 From: Sathish Date: Tue, 5 Oct 2021 10:28:49 +0530 Subject: [PATCH 8/9] add doc resources Signed-off-by: Sathish --- README.md | 2 + docs/resources/azure_power_bi_gateway.md | 86 ++++++++++++++++++++++ docs/resources/azure_power_bi_gateways.md | 88 +++++++++++++++++++++++ 3 files changed, 176 insertions(+) diff --git a/README.md b/README.md index 48df1eef4..7a12b33d6 100644 --- a/README.md +++ b/README.md @@ -209,6 +209,8 @@ The following is a list of static resources. - [azure_postgresql_databases](docs/resources/azure_postgresql_databases.md) - [azure_postgresql_server](docs/resources/azure_postgresql_server.md) - [azure_postgresql_servers](docs/resources/azure_postgresql_servers.md) +- [azure_power_bi_gateway](docs/resources/azure_power_bi_gateway.md) +- [azure_power_bi_gateways](docs/resources/azure_power_bi_gateways.md) - [azure_public_ip](docs/resources/azure_public_ip.md) - [azure_redis_cache](docs/resources/azure_redis_cache.md) - [azure_redis_caches](docs/resources/azure_redis_caches.md) diff --git a/docs/resources/azure_power_bi_gateway.md b/docs/resources/azure_power_bi_gateway.md index e69de29bb..d92798807 100644 --- a/docs/resources/azure_power_bi_gateway.md +++ b/docs/resources/azure_power_bi_gateway.md @@ -0,0 +1,86 @@ +--- +title: About the azure_power_bi_gateway Resource +platform: azure +--- + +# azure_power_bi_gateway + +Use the `azure_power_bi_gateway` InSpec audit resource to test the properties related to Azure Power BI Gateway. + +## Azure REST API version, Endpoint, and HTTP Client Parameters + +This resource interacts with API versions supported by the resource provider. The `api_version` is defined as a resource parameter. +If not provided, the latest version is used. For more information, refer to [`azure_generic_resource`](azure_generic_resource.md). + +Unless defined, `azure_cloud` global endpoint and default values for the HTTP client are used. For more information, refer to the resource pack [README](../../README.md). + +## Availability + +### Installation + +This resource is available in the [InSpec Azure resource pack](https://github.com/inspec/inspec-azure). For an example, `inspec.yml` file and how to set up your Azure credentials, refer to resource pack [README](../../README.md#Service-Principal). + +## Syntax + +`gateway_id` is a required parameter. + +```ruby +describe azure_power_bi_gateway(gateway_id: 'GATEWAY_ID') do + it { should exist } +end +``` + +## Parameters + +| Name | Description | +|----------------|----------------------------------------------------------------------------------| +| gateway_id | The gateway ID. | + +The parameter set should be provided for a valid query: + +- `gateway_id` + +## Properties + +| Property | Description | +|-------------------------------------|------------------------------------------------------------------| +| id | The gateway ID. | +| name | The gateway name. | +| type | The gateway type. | +| publicKey.exponent | The public key exponent. | +| publicKey.modulus | The public key modulus. + +For properties applicable to all resources, such as `type`, `name`, `id`, and `properties`, refer to [`azure_generic_resource`](azure_generic_resource.md#properties). + +Also, refer to [Azure documentation](https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/get-gateway) for other properties available. + +## Examples + +### Test that the Power BI Gateway's exponent is `AQAB` + +```ruby +describe azure_power_bi_gateway(gateway_id: 'GATEWAY_ID') do + its('publicKey.exponent') { should eq 'AQAB' } +end +``` + +## Matchers + +This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our [Universal Matchers page](/inspec/matchers/). + +### exists + +```ruby +# If the Azure Power BI Gateway is found, it will exist +describe azure_power_bi_gateway(gateway_id: 'GATEWAY_ID') do + it { should exist } +end +# if the Azure Power BI Gateway is not found, it will not exist +describe azure_power_bi_gateway(gateway_id: 'GATEWAY_ID') do + it { should_not exist } +end +``` + +## Azure Permissions + +Your [Service Principal](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal) must be set up with a `Dataset.Read.All` role on the Azure Power BI Workspace you wish to test. \ No newline at end of file diff --git a/docs/resources/azure_power_bi_gateways.md b/docs/resources/azure_power_bi_gateways.md index e69de29bb..3857c2ba2 100644 --- a/docs/resources/azure_power_bi_gateways.md +++ b/docs/resources/azure_power_bi_gateways.md @@ -0,0 +1,88 @@ +--- +title: About the azure_power_bi_gateways Resource +platform: azure +--- + +# azure_power_bi_gateways + +Use the `azure_power_bi_gateways` InSpec audit resource to test the properties related to all AzurePower BI Gateways. + +## Azure REST API version, Endpoint, and HTTP Client Parameters + +This resource interacts with API versions supported by the resource provider. The `api_version` is defined as a resource parameter. +If not provided, the latest version is used. For more information, refer to [`azure_generic_resource`](azure_generic_resource.md). + +Unless defined, `azure_cloud` global endpoint and default values for the HTTP client is used. For more information, refer to the resource pack [README](../../README.md). + +## Availability + +### Installation + +This resource is available in the [InSpec Azure resource pack](https://github.com/inspec/inspec-azure). For an example, `inspec.yml` file and how to set up your Azure credentials, refer to resource pack [README](../../README.md#Service-Principal). + +## Syntax + +An `azure_power_bi_gateways` resource block returns all AzurePower BI Gateways. + +```ruby +describe azure_power_bi_gateways do + #... +end +``` + +## Parameters + +## Properties + +|Property | Description | Filter Criteria* | +|--------------------------------|------------------------------------------------------------------------|------------------| +| ids | List of all gateway IDs. | `id` | +| names | List of all the gateway names. | `name` | +| types | List of all the gateway types. | `type` | +| exponents | List of all public key exponents. | `exponent` | +| modulus | List of all public key modulus. | `modulus` | + + +* For information on how to use filter criteria on plural resources refer to [FilterTable usage](https://github.com/inspec/inspec/blob/master/dev-docs/filtertable-usage.md). +Also, refer to [Azure documentation](https://docs.microsoft.com/en-us/rest/api/power-bi/Gateways/get-Gateways) for other properties available. + +## Examples + +### Loop throughPower BI Gateways by their IDs + +```ruby +azure_power_bi_gateways.ids.each do |id| + describe azure_power_bi_gateway(gateway_id: id) do + it { should exist } + end +end +``` + +### Test to ensure all Power BI Gateways exponent is `AQAB` + +```ruby +describe azure_power_bi_gateways.where(exponent: 'AQAB') do + it { should exist } +end +``` + +## Matchers + +This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our [Universal Matchers page](https://www.inspec.io/docs/reference/matchers/). + +### exists + +```ruby +# Should not exist if no Power BI Gateways are present +describe azure_power_bi_gateways do + it { should_not exist } +end +# Should exist if the filter returns at least one Power BI Gateways +describe azure_power_bi_gateways do + it { should exist } +end +``` + +## Azure Permissions + +Your [Service Principal](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal) must be set up with a `Dataset.Read.All` role on the Azure Power BI Workspace you wish to test. \ No newline at end of file From 8944a03919a9db3572f52c9649cad0bf015e1abc Mon Sep 17 00:00:00 2001 From: Ian Maddaus Date: Wed, 27 Oct 2021 15:42:22 -0600 Subject: [PATCH 9/9] Docs edits Signed-off-by: Ian Maddaus --- docs/resources/azure_power_bi_gateway.md | 18 +++++++----------- docs/resources/azure_power_bi_gateways.md | 16 ++++++++-------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/docs/resources/azure_power_bi_gateway.md b/docs/resources/azure_power_bi_gateway.md index d92798807..6a37f23ab 100644 --- a/docs/resources/azure_power_bi_gateway.md +++ b/docs/resources/azure_power_bi_gateway.md @@ -5,7 +5,7 @@ platform: azure # azure_power_bi_gateway -Use the `azure_power_bi_gateway` InSpec audit resource to test the properties related to Azure Power BI Gateway. +Use the `azure_power_bi_gateway` InSpec audit resource to test the properties related to Azure Power BI gateway. ## Azure REST API version, Endpoint, and HTTP Client Parameters @@ -32,13 +32,9 @@ end ## Parameters -| Name | Description | -|----------------|----------------------------------------------------------------------------------| -| gateway_id | The gateway ID. | +`gateway_id` _(required)_ -The parameter set should be provided for a valid query: - -- `gateway_id` +The gateway ID. ## Properties @@ -56,7 +52,7 @@ Also, refer to [Azure documentation](https://docs.microsoft.com/en-us/rest/api/p ## Examples -### Test that the Power BI Gateway's exponent is `AQAB` +### Test that the Power BI gateway's exponent is `AQAB` ```ruby describe azure_power_bi_gateway(gateway_id: 'GATEWAY_ID') do @@ -71,11 +67,11 @@ This InSpec audit resource has the following special matchers. For a full list o ### exists ```ruby -# If the Azure Power BI Gateway is found, it will exist +# If the Azure Power BI gateway is found, it will exist describe azure_power_bi_gateway(gateway_id: 'GATEWAY_ID') do it { should exist } end -# if the Azure Power BI Gateway is not found, it will not exist +# if the Azure Power BI gateway is not found, it will not exist describe azure_power_bi_gateway(gateway_id: 'GATEWAY_ID') do it { should_not exist } end @@ -83,4 +79,4 @@ end ## Azure Permissions -Your [Service Principal](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal) must be set up with a `Dataset.Read.All` role on the Azure Power BI Workspace you wish to test. \ No newline at end of file +Your [Service Principal](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal) must be set up with a `Dataset.Read.All` role on the Azure Power BI Workspace you wish to test. diff --git a/docs/resources/azure_power_bi_gateways.md b/docs/resources/azure_power_bi_gateways.md index 3857c2ba2..744167e67 100644 --- a/docs/resources/azure_power_bi_gateways.md +++ b/docs/resources/azure_power_bi_gateways.md @@ -5,7 +5,7 @@ platform: azure # azure_power_bi_gateways -Use the `azure_power_bi_gateways` InSpec audit resource to test the properties related to all AzurePower BI Gateways. +Use the `azure_power_bi_gateways` InSpec audit resource to test the properties related to all Azure Power BI gateways. ## Azure REST API version, Endpoint, and HTTP Client Parameters @@ -22,7 +22,7 @@ This resource is available in the [InSpec Azure resource pack](https://github.co ## Syntax -An `azure_power_bi_gateways` resource block returns all AzurePower BI Gateways. +An `azure_power_bi_gateways` resource block returns all Azure Power BI gateways. ```ruby describe azure_power_bi_gateways do @@ -44,11 +44,11 @@ end * For information on how to use filter criteria on plural resources refer to [FilterTable usage](https://github.com/inspec/inspec/blob/master/dev-docs/filtertable-usage.md). -Also, refer to [Azure documentation](https://docs.microsoft.com/en-us/rest/api/power-bi/Gateways/get-Gateways) for other properties available. +Also, refer to [Azure documentation](https://docs.microsoft.com/en-us/rest/api/power-bi/Gateways/get-Gateways) for other available properties. ## Examples -### Loop throughPower BI Gateways by their IDs +### Loop through Power BI gateways by their IDs ```ruby azure_power_bi_gateways.ids.each do |id| @@ -58,7 +58,7 @@ azure_power_bi_gateways.ids.each do |id| end ``` -### Test to ensure all Power BI Gateways exponent is `AQAB` +### Test to ensure all Power BI gateways exponent is `AQAB` ```ruby describe azure_power_bi_gateways.where(exponent: 'AQAB') do @@ -73,11 +73,11 @@ This InSpec audit resource has the following special matchers. For a full list o ### exists ```ruby -# Should not exist if no Power BI Gateways are present +# Should not exist if no Power BI gateways are present describe azure_power_bi_gateways do it { should_not exist } end -# Should exist if the filter returns at least one Power BI Gateways +# Should exist if the filter returns at least one Power BI gateways describe azure_power_bi_gateways do it { should exist } end @@ -85,4 +85,4 @@ end ## Azure Permissions -Your [Service Principal](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal) must be set up with a `Dataset.Read.All` role on the Azure Power BI Workspace you wish to test. \ No newline at end of file +Your [Service Principal](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal) must be set up with a `Dataset.Read.All` role on the Azure Power BI Workspace you wish to test.