The Azure Service Diagnostic Settings Plugin integrates RightScale Self-Service with the functionality of the Service Diagnostic Settings resource in the Azure API.
- A general understanding CAT development and definitions
- Refer to the guide documentation for details SS Guides
- The
admin,ss_designer&ss_end_userroles, in a RightScale account with SelfService enabled.adminis needed to retrieved the RightScale Credential values identified below. - Azure Service Principal (AKA Azure Active Directory Application) with the appropriate permissions to manage resources in the target subscription
- The following RightScale Credentials
AZURE_APPLICATION_IDAZURE_APPLICATION_KEY
- The following packages are also required (See the Installation section for details):
- Be sure your RightScale account has Self-Service enabled
- Connect AzureRM Cloud credentials to your RightScale account (if not already completed)
- Follow steps to Create an Azure Active Directory Application
- Grant the Azure AD Application access to the necessary subscription(s)
- Retrieve the Application ID & Authentication Key
- Create RightScale Credentials with values that match the Application ID (Credential name:
AZURE_APPLICATION_ID) & Authentication Key (Credential name:AZURE_APPLICATION_KEY) - Retrieve your Tenant ID
- Update
rs_azure_diagnostic_settings_plugin.rbPlugin with your Tenant ID.- Replace "TENANT_ID" in
token_url "https://login.microsoftonline.com/TENANT_ID/oauth2/token"with your Tenant ID
- Replace "TENANT_ID" in
- Navigate to the appropriate Self-Service portal
- For more details on using the portal review the SS User Interface Guide
- In the Design section, use the
Upload CATinterface to complete the following:- Upload each of packages listed in the Requirements Section
- Upload the
rs_azure_diagnostic_settings_plugin.rbfile located in this repository
The plugin has been packaged as plugins/rs_azure_diagnostic_settings. In order to use this plugin you must import this plugin into a CAT.
import "plugins/rs_azure_diagnostic_settings"For more information on using packages, please refer to the RightScale online documentation. Importing a Package
There is a "subscription_id" Plugin Parameter in the Plugin. Recommended usage (where the default value matches your target Subscription ID):
parameter "subscription_id" do
like $rs_azure_template.subscription_id
default "12345678-1234-1234-1234-123456789012"
endNote: default is not a required field. You could, instead, elect to populate this parameter at every CloudApp Launch.
Note: There are many possible configurations when defining a diagnostic_settings resource. More detailed API documentation is available here.
| Field Name | Required? | Description |
|---|---|---|
| name | yes | Reference name |
| resource_uri | yes | Uri of the resource to configure diagnostic settings on |
| location | yes | even though its required, the value should be empty |
| properties | yes | Hash of diagnostic settings (see examples and Azure API documentation for more details) |
- id
- name
Service Diagnostic Settings can now be created by specifying a resource declaration with the desired fields. See the Supported Actions section for a full list of supported actions. The resulting resource can be manipulated just like the native RightScale resources in RCL and CAT. See the Examples Section for more examples and complete CAT's.
#Configures AuditEvent logging on a KeyVault
resource "vault_diagnostic_settings", type: "rs_azure_diagnostic_settings.diagnostic_settings" do
name join(["diagnostic_settings-",last(split(@@deployment.href, "/"))])
resource_uri "/subscriptions/SUBSCRIPTION_ID/resourceGroups/RightScale-Testing/providers/Microsoft.KeyVault/vaults/RS-Vault"
location ""
properties do {
"storageAccountId" => "/subscriptions/SUBSCRIPTION_ID/resourceGroups/RightScale-Testing/providers/Microsoft.Storage/storageAccounts/rskeyvaultaudits",
"logs" => [ {
"category" => "AuditEvent",
"enabled" => "true",
"retentionPolicy" => {
"enabled" => "false",
"days" => 0
}
} ]
} end
end| Action | API Implementation | Support Level |
|---|---|---|
| create & update | Service Diagnostic Settings - CreateOrUpdate | Supported |
| get | Service Diagnostic Settings - Get | Supported |
| update | Service Diagnostic Settings - Update | Supported |
Please review diagnostic_settings_test_cat.rb for a basic example implementation that creates a Storage Account, Key Vault and configures Diagnostic Settings for Audit Logging.
- None
The Azure Service Diagnostic Settings Plugin source code is subject to the MIT license, see the LICENSE file.