Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jrauschenbusch committed Jun 12, 2020
1 parent 31c2247 commit 99bf011
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Expand Up @@ -150,9 +150,9 @@ func resourceArmKustoDatabasePrincipalCreate(d *schema.ResourceData, meta interf
return fmt.Errorf("Error loading Kusto Database %q (Resource Group %q, Cluster %q): %+v", databaseName, resourceGroup, clusterName, err)
}

database, ok := resp.Value.AsDatabase()
database, ok := resp.Value.AsReadWriteDatabase()
if !ok {
return fmt.Errorf("Exisiting resource is not a Kusto Database %q (Resource Group %q, Cluster %q)", databaseName, resourceGroup, clusterName)
return fmt.Errorf("Exisiting resource is not a Kusto Read/Write Database %q (Resource Group %q, Cluster %q)", databaseName, resourceGroup, clusterName)
}

resourceID := fmt.Sprintf("%s/Role/%s/FQN/%s", *database.ID, role, fqn)
Expand Down Expand Up @@ -181,9 +181,7 @@ func resourceArmKustoDatabasePrincipalCreate(d *schema.ResourceData, meta interf
Fqn: utils.String(fqn),
// These three must be specified or the api returns `The request is invalid.`
// For more info: https://github.com/Azure/azure-sdk-for-go/issues/6547
Email: utils.String(""),
AppID: utils.String(""),
Name: utils.String(""),
Name: utils.String(""),
}

principals := []kusto.DatabasePrincipal{kustoPrincipal}
Expand Down
Expand Up @@ -167,7 +167,7 @@ resource "azurerm_kusto_database_principal" "test" {
role = "Viewer"
type = "App"
client_id = data.azurerm_client_config.current.tenant_id
object_id = data.azurerm_client_config.current.client_id
object_id = data.azurerm_client_config.m.client_id
}
`, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger)
}

0 comments on commit 99bf011

Please sign in to comment.